<?php  

header('Content-Type:text/html;Charset=utf-8;');  
include "RSA.php";  
echo '<pre>';  
  
$pubfile = 'pu.pem';  
$prifile = 's.pem';  
$rsa = new RSA($pubfile, $prifile);  


$a['sina']='Sina';
$a['jobprovince']='浙江';
$a['uid']='12272942';

$a['sightml']='哈哈哈哈哈晕晕乎乎刚刚给哈哈哈哈哈哈哈哈哈哈肉你奶奶家';
$a['tags']='2-3';
$a['weixin']='weixin223456';
$a['sina_show']='1';
$a['qq_show']='1';
$a['qq']='25855555';
$a['weixin_show']='1';
$a['job']='设计师';
$a['gender']='0';
$a['jobcity']='杭州';

/*
$a['tid'] = 443683;
$a['cid']=23;
$a['author']='uiyuuuuuuuuuuuuuuuuu';
$a['authorid']=76;
$a['subject']='zjzjzjzjz4334';
$a['message']='9';
$a['attachment']=1;
$a['image']='655555555555555555';

$b['filename']='zzz2';
$b['description']='zzz2';
$b['attachment']='zzz2';
$c['filename']='jjj2';
$c['description']='kjjkj2';
$c['attachment']='jjjjj2';
$e['filename']='ioio2';
$e['description']='ioi2';
$e['attachment']='ioio2';

$a['attachment_list']=array($b,$c,$e);
*/
/*
$a['tid']=443682;
$a['message']='9i080-89-9-9-';
$a['author']='azjzjzjzjjzjzjzjjzj5555';
$a['authorid']='14345271';
$a['attachment']=1;

$b['filename']='zzz';
$b['description']='zzz';
$b['attachment']='zzz';
$c['filename']='jjj';
$c['description']='kjjkj';
$c['attachment']='jjjjj';
$e['filename']='ioio';
$e['description']='ioi';
$e['attachment']='ioio';

$a['attachment_list']=array($b,$c,$e);

$a['pid']=7210569;
$a['message']='nmmmmmmmmmmmmmmmmm';
$a['author']='nmmmmmmmmmmmmmmmmmmmm';
$a['authorid']='11313381';

*/
$rst = $a;
$ex = json_encode($rst);  
//加密  
$ret_e = $rsa->encrypt($ex);   
echo '<textarea rows="130" cols="200">';  

echo $ret_e;  
echo '</textarea>';



$sss = "T1ozZNAOt0M/kMWT27RNRYfasISdNXQgHbK1g6f0k13Ul016q1ndsVccq65fIpjTzHvc49ZvlOtbTltVmK+9kY81wWBQvq2cNmLrNFFlhjgC400xWO5Bq12463XaLVShuF0Bp9h7SckgTHBNDdcqFKNCTPanKrghk/0DqN9gOgc=Itxy/TDcMvw8aBwQKnN32RXmwPhs/7Pazc4rO9mZSGvZ2qnFfH8VORYGmE1z1U0ZzIFRaZKOfXYrvCIGekkE7piSGu62tvNp9LDfoaD48RB62cZEzPXMy8EXNAzdImm9KLTUI3T+Z0DFZ0fQlB97v92yAvkBkGYDlYArfY16QgE=";//加密  
echo '<br/>';
$da = $rsa->decrypt2($ret_e); 
var_dump(json_decode($da));exit;
/*echo '<pre>';  
  
$a = 'test';  
//签名  
$x = $rsa->sign($a);  
//验证  
$y = $rsa->verify($a, $x);  
var_dump($x, $y);  
exit; */